namespace ETestIT.Tests.Data.SetUpDb
{
    using ETestIT.Core;
    using SharpArch.Data.NHibernate;

    public class ProductionBuilder : IBuilder
    {
        public void Build()
        {
            var session = NHibernateSession.Current;

            var adminUser = new User("admin", "admin");
            session.Save(adminUser);

            var jobTitleNet = new JobTitle(".net");
            var jobTitleJava = new JobTitle("Java");

            session.Save(jobTitleNet);
            session.Save(jobTitleJava);

            var canJeremy = new Candidate() { FirstName = "Jeremy", Surename = "Miller",ProfileTitle = jobTitleNet, Category = Candidate.CandidateCategories.Employees, Email = "x@gmail.com", Phone = "1234" };
            var canCorney = new Candidate() { FirstName = "Rob", Surename = "Corney",ProfileTitle = jobTitleJava,Category = Candidate.CandidateCategories.External, Email = "y@gmail.com", Phone = "1235" };

            session.Save(canJeremy);
            session.Save(canCorney);

            var client1 = new Client(){Name = "IBM", ContactInformation = "234234234", TypeOfClient = ClientType.Direct};
            var client2 = new Client(){Name = "DELL", ContactInformation = "333334", TypeOfClient = ClientType.Partners};

            session.Save(client1);
            session.Save(client2);

            session.Flush();
        }
    }

}